Image compressor components use the compressor capability structure to report their capabilities to the Image Compression Manager. Before compressing or decompressing an image, the Image Compression Manager requests this capability information from the component that will be handling the operation by calling the CDPreCompress or CDPreDecompress function provided by that component. The compressor component examines the compression or decompression parameters and indicates any restrictions on its ability to satisfy the request in a formatted compressor capability structure. The Image Compression Manager then manages the operation according to the capabilities of the component.
The CodecCapabilities data type defines the compressor capability structure.
typedef struct {
long flags; /* control information */
short wantedPixelSize; /* pixel depth for component
to use with image */
short extendWidth; /* extension width of image
in pixels */
short extendHeight; /* extension height of image
in pixels */
short bandMin; /* supported minimum
image band height */
short bandInc; /* common factor of
supported band heights */
short pad; /* reserved */
unsigned long time; /* milliseconds operation
takes to complete */
} CodecCapabilities;
typedef CodecCapabilities *CodecCapabilitiesPtr;
The flags field of the compressor capability structure contains flags that exchange control information between the Image Compression Manager and the compressor component. Components use flags in the low-order 16 bits to indicate their capabilities to the manager. The Image Compression Manager may use flags in the high-order 16 bits to pass control information to the component.
The following flags are defined:
#define codecCanScale (1L<<0) /* decompressor scales
information */
#define codecCanMask (1L<<1) /* decompressor applies mask to
image */
#define codecCanMatte (1L<<2) /* decompressor blends image using
matte */
#define codecCanTransform (1L<<3) /* decompressor works with complex
placement matrices */
#define codecCanTransferMode (1L<<4) /* decompressor accepts transfer
mode */
#define codecCanCopyPrev (1L<<5) /* compressor updates previous
image buffer */
#define codecCanSpool (1L<<6) /* component can use functions to
spool data */
#define codecCanClipVertical (1L<<7) /* decompressor clips image
vertically */
#define codecCanClipRectangular (1L<<8) /* decompressor clips image
vertically & horizontally */
#define codecCanRemapColor (1L<<9) /* compressor remaps color */
#define codecCanFastDither (1L<<10) /* compressor supports fast
dithering */
#define codecCanSrcExtract (1L<<11) /* compressor extracts portion
of source image */
#define codecCanCopyPrevComp (1L<<12) /* compressor updates previous
image buffer */
#define codecCanAsync (1L<<13) /* component can work
asynchronously */
#definecodecCanMakeMask (1L<<14) /* decompressor makes
modification masks */
#define codecCanShift (1L<<15) /* component works with pixels
that are not byte-aligned */
The following flags are currently unused by the Image Compression Manager: codecCanClipVertical , codecCanClipRectangular , and codecCanFastDither .